// -----------------------------------------------------------------------------
// Copyright (c) 2014-2023 All rights reserved
// *********************************************************************************
// Project Name : 
// Author       : DFY
// File Name    : wallace8bit.v
// Abstract     : 8bit input wallace 
module wallace8bit(
  input  [5:0]  cin,
  input  [7:0]   in,
  
  output        c,
  output        s,  
  output [5:0]  cout 
);
//=================================================================================
// Signal and Parameter declaration
//=================================================================================

wire [2:0] s_level0;
wire [1:0] s_level1;
wire       s_level2;

//=================================================================================
// Body
//=================================================================================
full_adder level0_0_full_adder (.in(in[2:0]), .cout(cout[0]), .s(s_level0[0]));
full_adder level0_1_full_adder (.in(in[5:3]), .cout(cout[1]), .s(s_level0[1]));
full_adder level0_2_full_adder (.in({in[7:6],1'b0}), .cout(cout[2]), .s(s_level0[2]));

full_adder level1_0_full_adder (.in(s_level0), .cout(cout[3]), .s(s_level1[0]));
full_adder level1_1_full_adder (.in(cin[2:0]), .cout(cout[4]), .s(s_level1[1]));

full_adder level2_0_full_adder (.in({s_level1[1:0],cin[3]}), .cout(cout[5]), .s(s_level2));

full_adder level3_0_full_adder (.in({s_level2,cin[5:4]}), .cout(c), .s(s));
endmodule
